{% extends "learing_logs/base.html" %}

{% block header %}
    <h4>{{ topic.text }}</h4>
    <a href="{% url 'learing_logs:new_entry' topic.id %}">添加条目</a>
{% endblock header %}

{% block content %}       
    {% for entry in entries %}

        <div class="panel panel-default" >
            <div class="panel-heading">
                <h4>
                    {{ entry.date_added|date:'Y-m-d H:i:s' }}
                </h4>
                <small>
                        <a href="{% url 'learing_logs:edit_entry' entry.id %}">编辑</a>
                </small>

            </div>
            <div class="panel-body" >
                    {{ entry.text|linebreaks }}
            </div>
        </div>

        <!-- 过滤器函数的使用 -->        
      
    {% empty %}
        <h5>该主题还没创建条目</h5>
    {% endfor %}
    <h6>
            <a href="{% url 'learing_logs:new_topic' %}">添加新主题</a>
    </h6>
{% endblock content %}